#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket

st = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

ip_port = ("127.0.0.1", 2000)

while True:
    inp = input(">>>: ").strip()
    if not inp: continue

    st.sendto(inp.encode("utf-8"), ip_port)
    s_data, addr = st.recvfrom(1024)
    print(s_data.decode("utf-8"), addr)

socket.close()
